<style>
    /* 打开宽度限制 */
    .popover {
        max-width: 30vw;
    }
</style>
<div class="container-fluid" id="boxersale">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="alert alert-dismissable alert-info" id="headeralert">
                <button type="button" class="close">×</button>
                <p></p>
            </div>
        </div>
    </div>
    <div class="ntDesktop">
        {if condition="$isshow==1"}
        <div class="ntDesktop-head">配货界面（装箱员）</div>
        {/if}
        <div class="row" style="padding-top:0px">
            <div class="col-md-6">
                <ul class="nav nav-tabs">
                    <li class="active" @click="changestatus('1')">
                        <a href="#boxing" data-toggle="tab">
                            配货中 <span class="label label-info">{{countnum.countnumone}}</span>
                        </a>
                    </li>
                    <li @click="changestatus('2')">
                        <a href="#boxed" data-toggle="tab">
                            已装箱 <span class="label label-info">{{countnum.countnumtwo}}</span>
                        </a>
                    </li>
                    <li  @click="changestatus('3')">
                        <a href="#finish" data-toggle="tab">
                            已完成 <span class="label label-info">{{countnum.countnumthree}}</span>
                        </a>
                    </li>
                </ul>
            </div>
            <div class="col-md-4">
                <div class="input-group">
                    <input type="text" class="form-control" placeholder="输入公司名或订单号" @keyup.13="render" v-model="dname">
                    <div class="input-group-btn">
                        <button class="btn btn-primary" @click="render"><span class="fa fa-search"></span> 查找</button>
                    </div>
                </div>
            </div>
            <div class="col-md-2 text-right" v-show="status!=1">
                <button class="btn btn-default btn-checkbox" @click="checkadmin">
                    <input type="checkbox" class="form-input"> 只显示我的工作
                </button>
            </div>
        </div>

        <div class="row tab-content">

            <!-- 配货中 -->
            <div class="col-md-12 tab-pane active" id="boxing">
                <table class="table table-striped table-hover ntTable">
                    <thead>
                    <tr>
                        <th width="4%"> 订单号</th>
                        <th width="4%"> 优先</th>
                        <th width="4%"> 时间</th>
                        <th width="20%"> 公司</th>
                        <th width="15%"> 产品</th>
                        <th> 箱规</th>
                        <th> 数量</th>
                        <th> 对货员</th>
                        <th> 业务员</th>
                        <th> 操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr v-for="(item,index) in listone" :key="item.id">
                        <td><span v-if="item.sale_id">{{formatUnit(item.sale_id,'ID')}}</span></td>
                        <td align="center"><span class="label label-danger" v-if="item.sale_id">{{item.priority}}</span></td>
                        <td class="text-success"><b v-if="item.sale_id">{{item.interval_time}}</b></td>
                        <td><span v-if="item.sale_id">{{item.company_name}}</span></td>
                        <td>
                            <div class="pro">
                                <div class="pro-icon">
                                    <img :src="item.pro_data.img_url" border="0" width="48px"
                                         height="48px">
                                </div>
                                <div class="pro-name">
                                    <small> {{formatUnit(item.pro_data.prochar_id,'ID') + (item.pro_data.brand_name ? ' / '+item.pro_data.brand_name :'')+ (item.pro_data.model ? ' / '+item.pro_data.model :'')}}
                                    </small>
                                    <br>
                                    {{item.pro_data.pro_name}}
                                </div>
                            </div>
                        </td>
                        <td align="right">
                            {{item.pro_data.prochar_qty}}
                            <small class="unit">PCS/CTN</small>
                            <br>
                            {{item.pro_data.ctn_size}}
                            <small class="unit">CM</small>
                        </td>
                        <td align="right">
                            {{formatUnit(item.qty,'PCS')}}
                            <small class="unit">PCS</small>
                        </td>
                        <td><span v-if="item.sale_id">{{item.checker_name}}</span></td>
                        <td><span v-if="item.sale_id">{{item.saler_name}}</span></td>
                        <td align="right">
                            {in name="269" value="$Think.session.admin.auth_ids"}
                            <a v-if="item.sale_id" :href="'/admin/finance/boxerboxing?names=1&sale_id='+item.sale_id" class="btn btn-sm btn-primary" @click="gotoboxing">装箱单</a>
                            {/in}
                        </td>
                    </tr>
                    <tr style="text-align: center;" v-if="listone.length==0">
                        <td colspan="11" class="no_date">{:strtoupper(lang('no_data'))}</td>
                    </tr>
                    </tbody>
                </table>
                <div class="row clearfix">
                    <div class="col-md-12 column">
                        <ul class="pagination" id="paginationone" v-show="listone.length!=0">
                        </ul>
                    </div>
                </div>
            </div>


            <!-- 已装箱 -->
            <div class="col-md-12 tab-pane" id="boxed">
                <table class="table table-striped table-hover ntTable">
                    <thead>
                    <tr>
                        <th width="4%"> 订单号</th>
                        <th width="4%"> 优先</th>
                        <th width="25%"> 公司</th>
                        <th> 产品数量</th>
                        <th> 箱数</th>
                        <th> 体积</th>
                        <th> 重量</th>
                        <th> 装箱员</th>
                        <th> 备注</th>
                        <th> 对货员</th>
                        <th> 业务员</th>
                        <th> 操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr v-for="(item,index) in listwo" :key="item.id">
                        <td>{{formatUnit(item.sale_id,'ID')}}</td>
                        <td align="center"><span class="label label-danger">{{item.priority}}</span></td>
                        <td>{{item.company_name}}</td>
                        <td align="right">
                            <!--产品数量-->
                            {{item.pronum}}
                            <small class="unit">PROS</small>
                        </td>
                        <td align="right">
                            <!--箱数-->
                            {{formatUnit(item.ctns,'CTN')}}
                            <small class="unit">CTN</small>
                        </td>
                        <td align="right">
                            <!--体积-->
                            {{formatUnit(item.volume,'CBM')}}
                            <small class="unit">CBM</small>
                        </td>
                        <td align="right">
                            <!--重量-->
                            {{formatUnit(item.kgs,'KGS')}}
                            <small class="unit">KGS</small>
                        </td>
                        <td>
                            <!--装箱者-->
                            {{item.create_name}}<br>
                            <small>{{item.create_date}}</small>
                        </td>
                        <td>
                            <!--装箱备注-->
                            <button  @mouseover="setpopper" class="btn btn-sm btn-default"  v-if="item.remark.length>0" data-toggle="popover" title="备注">
                                备注
                                <div class="content">
                                    <div style="width:30vw">
                                        <ul>
                                            <li v-for="remarkname in item.remark" :key="remarkname.id">
                                                {{remarkname.remark}}
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </button>
                        </td>
                        <!--对货员-->
                        <td>{{item.checker_name}}</td>
                        <!--业务员-->
                        <td>{{item.saler_name}}</td>
                        <td align="right">
                            {in name="272" value="$Think.session.admin.auth_ids"}
                            <button @click="chakan(item.sale_id)" type="button" class="btn btn-sm btn-default" data-toggle="modal"
                                    data-target="#box_viewModal">查看
                            </button>
                            {/in}
                            {in name="269" value="$Think.session.admin.auth_ids"}
                            <a v-if="item.istrue==2" :href="'/admin/finance/boxerboxing?names=2&sale_id='+item.sale_id" @click="gotoboxing" class="btn btn-sm btn-primary">装箱单</a>
                            {/in}
                        </td>
                    </tr>
                    <tr style="text-align: center;" v-if="listwo.length==0">
                        <td colspan="12" class="no_date">{:strtoupper(lang('no_data'))}</td>
                    </tr>
                    </tbody>
                </table>
                <div class="row clearfix">
                    <div class="col-md-12 column">
                        <ul class="pagination" id="paginationtwo" v-show="listwo.length!=0">
                        </ul>
                    </div>
                </div>
            </div>


            <!-- 已完成 -->
            <div class="col-md-12 tab-pane" id="finish">
                <table class="table table-striped table-hover ntTable">
                    <thead>
                    <tr>
                        <th width="4%"> 订单号</th>
                        <th width="4%"> 优先</th>
                        <th width="25%"> 公司</th>
                        <th> 产品数量</th>
                        <th> 箱数</th>
                        <th> 体积</th>
                        <th> 重量</th>
                        <th> 装箱员</th>
                        <th> 备注</th>
                        <th> 对货员</th>
                        <th> 业务员</th>
                        <th> 操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr v-for="(item,index) in listhree" :key="item.id">
                        <td>{{formatUnit(item.sale_id,'ID')}}</td>
                        <td align="center"><span class="label label-danger">{{item.priority}}</span></td>
                        <td>{{item.company_name}}</td>
                        <td align="right">
                            <!--产品数量-->
                            {{item.pronum}}
                            <small class="unit">PROS</small>
                        </td>
                        <td align="right">
                            <!--箱数-->
                            {{formatUnit(item.ctns,'CTN')}}
                            <small class="unit">CTN</small>
                        </td>
                        <td align="right">
                            <!--体积-->
                            {{formatUnit(item.volume,'CBM')}}
                            <small class="unit">CBM</small>
                        </td>
                        <td align="right">
                            <!--重量-->
                            {{formatUnit(item.kgs,'KGS')}}
                            <small class="unit">KGS</small>
                        </td>
                        <td>
                            <!--装箱者-->
                            {{item.create_name}}<br>
                            <small>{{item.create_date}}</small>
                        </td>
                        <td>
                            <button class="btn btn-sm btn-default" @mouseover="setpopper" v-if="item.remark.length>0" data-toggle="popover"
                                    title="备注">
                                备注
                                <div class="content">
                                    <div style="width:30vw">
                                        <ul>
                                            <li v-for="remarkname in item.remark" :key="remarkname.id">
                                                {{remarkname.remark}}
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </button>
                        </td>
                        <td>{{item.checker_name}}</td>
                        <td>{{item.saler_name}}</td>
                        <td align="right">
                            {in name="272" value="$Think.session.admin.auth_ids"}
                            <button @click="chakan(item.sale_id)" type="button" class="btn btn-sm btn-default" data-toggle="modal"
                                    data-target="#box_viewModal">查看
                            </button>
                            {/in}
                        </td>
                    </tr>
                    <tr style="text-align: center;" v-if="listhree.length==0">
                        <td colspan="12" class="no_date">{:strtoupper(lang('no_data'))}</td>
                    </tr>
                    </tbody>
                </table>
                <div class="row clearfix">
                    <div class="col-md-12 column">
                        <ul class="pagination" id="paginationthree" v-show="listhree.length!=0">
                        </ul>
                    </div>
                </div>
            </div>

        </div>

    </div>
    <!-- 配货-装箱 查看 弹窗开始 -->
    <div class="modal fade" id="box_viewModal" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-lg" style="width:80%">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title">订单（8888）装箱单查看</h4>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="alert alert-dismissable alert-info">
                                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                <h4> 信息框 </h4>
                                位置主要是列出提货到中转区（area=1）的位置。
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <ul class="nav nav-tabs">
                                <li class="active"><a href="#view_sale" data-toggle="tab">订单</a></li>
                                <li><a href="#view_box" data-toggle="tab">装箱单</a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="row tab-content" style="padding-top: 1rem">

                        <!-- 订单内容 -->
                        <div class="tab-pane active" id="view_sale">
                            <div class="col-md-4">
                                <div class="panel panel-default">
                                    <table class="table">
                                        <tbody>
                                        <tr>
                                            <td width="20%">订单号</td>
                                            <td>{{formatUnit(datares.leftdata.sale_id,'ID')}}</td>
                                        </tr>
                                        <tr>
                                            <td>公司</td>
                                            <td>{{datares.leftdata.companyname}}</td>
                                        </tr>
                                        <tr>
                                            <td>配单主管</td>
                                            <td>{{datares.leftdata.make_name}}</td>
                                        </tr>
                                        <tr>
                                            <td>对货员</td>
                                            <td>{{datares.leftdata.checker_name}}</td>
                                        </tr>
                                        <tr>
                                            <td>装箱员</td>
                                            <td>{{datares.leftdata.sale_packname}}</td>
                                        </tr>
                                        <tr>
                                            <td>发货区</td>
                                            <td>{{datares.leftdata.area_name}}</td>
                                        </tr>
                                        <tr>
                                            <!--一个销售订单对应多个备注-->
                                            <td>装箱备注</td>
                                            <td>
                                                <button class="btn btn-sm btn-default" v-if="remarklength>0" placement="right" @mouseover="setpopper" data-toggle="popover" title="备注内容">
                                                    备注
                                                    <div class="content" style="display: none;">
                                                        <div style="width:20vw">
                                                            <ul>
                                                                <li v-for="item in datares.leftdata.remark" :key="item.id">
                                                                    {{item.remark}}
                                                                </li>
                                                            </ul>
                                                        </div>
                                                    </div>
                                                </button>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>发票</td>
                                            <td>{{datares.leftdata.sale_invoicename}} / {{datares.leftdata.sale_invoicedate}}</td>
                                        </tr>
                                        <tr>
                                            <td>送货方式</td>
                                            <td>{{datares.leftdata.delivergoods}}</td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="col-md-8">
                                <div class="div-scroll" style="max-height:50vh">
                                    <div class="panel panel-default">
                                        <div class="panel-heading">
                                            订单内容
                                        </div>
                                        <table class="table table-hover">
                                            <thead>
                                            <tr>
                                                <th align="center">#</th>
                                                <th>产品</th>
                                                <th>箱规</th>
                                                <th>数量</th>
                                                <th>体积/重量</th>
                                                <th>取货位置</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr v-for="(item,index) in datares.prodata" :key="item.id">
                                                <td align="center">{{index+1}}</td>
                                                <td>
                                                    <div class="pro">
                                                        <div class="pro-icon">
                                                            <img :src="item.img_url" border="0" width="48px"
                                                                 height="48px">
                                                        </div>
                                                        <div class="pro-name">
                                                            <small> {{formatUnit(item.prochar_id,'ID') + (item.brand_name ? ' / '+item.brand_name :'')+ (item.model ? ' / '+item.model :'')}}
                                                            </small>
                                                            <br>
                                                            {{item.pro_name}}
                                                        </div>
                                                    </div>
                                                </td>
                                                <td align="right">
                                                    {{item.prochar_qty}}
                                                    <small class="unit">PCS/CTN</small>
                                                    <br>
                                                    {{item.ctn_size}}
                                                    <small class="unit">CM</small>
                                                </td>
                                                <td align="right">
                                                    {{item.qty}}
                                                    <small class="unit">PCS</small>
                                                </td>
                                                <td align="right">
                                                    {{formatUnit(item.ctn_m3,'CBM')}}
                                                    <small class="unit">CBM</small>
                                                    <br>
                                                    {{formatUnit(item.ctn_kgs,'KGS')}}
                                                    <small class="unit">KGS</small>
                                                </td>
                                                <td>{{item.areaname}}</td>
                                            </tr>
                                            </tbody>
                                            <tfoot>
                                            <tr>
                                                <td colspan="6" align="right">
                                                    合计体积: {{formatUnit(sumnum[0],'CBM')}}
                                                    <small class="unit">CBM</small>
                                                    /
                                                    重量: {{formatUnit(sumnum[1],'KGS')}}
                                                    <small class="unit">KGS</small>
                                                </td>
                                            </tr>
                                            </tfoot>
                                        </table>
                                    </div>
                                </div>
                            </div>

                        </div>

                        <div class="tab-pane" id="view_box">
                            <!-- 装箱内容 -->
                            <div class="col-md-12">
                                <div class="div-scroll" style="max-height:50vh">
                                    <table class="table table-hover ntTable">
                                        <thead>
                                        <tr>
                                            <th>箱号</th>
                                            <th>产品</th>
                                            <th>数量</th>
                                            <th>箱规</th>
                                            <th>箱数</th>
                                            <th>体积/重量</th>
                                            <th>备注</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <template v-for="(item ,index) in datares.sale_packdata" v-if="datares.sale_packdata.length>0">
                                            <tr v-for="(itemdata,itemdataIndex) in item.data">
                                                <template v-if="itemdataIndex == 0">
                                                    <td align="center">{{item.number}}</td>
                                                </template>
                                                <template v-else>
                                                    <td></td>
                                                </template>
                                                <!--装箱单下面的产品-->
                                                <td>
                                                    <div class="pro">
                                                        <div class="pro-icon">
                                                            <img :src="itemdata.img_url" border="0" width="48px"
                                                                 height="48px">
                                                        </div>
                                                        <div class="pro-name">
                                                            <small v-if="itemdata.prochar_id>0"> {{formatUnit(itemdata.prochar_id,'ID') + (itemdata.brand_name ? ' / '+itemdata.brand_name :'')+ (itemdata.model ? ' / '+itemdata.model :'')}}
                                                            </small>
                                                            <br>
                                                            {{itemdata.pro_name}}
                                                        </div>
                                                    </div>
                                                </td>
                                                <!--实际每箱装的数量-->
                                                <td align="right">
                                                    {{itemdata.reality_qty}}
                                                    <small class="unit">PCS</small>
                                                </td>
                                                <!--箱规-->
                                                <template v-if="itemdataIndex == 0">
                                                    <td align="right">
                                                        {{item.ctn_size}}<small class="unit">CM</small><br>
                                                        {{formatUnit(item.volume,'CBM')}}<small class="unit">CBM</small> /  {{formatUnit(item.kgs,'KGS')}}<small class="unit">KGS</small>
                                                    </td>
                                                    <!--箱数-->
                                                    <td align="right"> {{formatUnit(item.ctns,'CTN')}}
                                                        <small class="unit">CTN</small>
                                                    </td>
                                                    <!--体积、重量-->
                                                    <td align="right">
                                                        {{formatUnit(item.ctn_m3,'CBM')}}
                                                        <small class="unit">CBM</small>
                                                        <br>
                                                        {{formatUnit(item.ctn_kgs,'KGS')}}
                                                        <small class="unit">KGS</small>
                                                    </td>
                                                    <!--一个装箱单只会对应一个备注-->
                                                    <td align="right">
                                                        <button class="btn btn-sm btn-default" v-if="item.remark" @mouseover="setpopper" data-toggle="popover" title="备注内容">
                                                            备注
                                                            <div class="content" style="display: none;">
                                                                <div style="width:20vw">
                                                                    <ul>
                                                                        <li>{{item.remark}}</li>
                                                                    </ul>
                                                                </div>
                                                            </div>
                                                        </button>
                                                    </td>
                                                </template>
                                                <template v-else>
                                                    <td></td>
                                                    <td></td>
                                                    <td></td>
                                                    <td></td>
                                                </template>
                                            </tr>
                                        </template>
                                        </tbody>
                                    </table>
                                </div>
                            </div>

                        </div>


                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"><span
                            class="glyphicon glyphicon-remove"></span>取消
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/foot"/}
<script>
    var table = new Vue({
        el: '#boxersale',
        data: {
            listone: [],
            listwo: [],
            listhree: [],
            status: '1',
            page: '1',
            pageSize: 30,
            admin_id:false,
            //头部数字
            countnum: {
                countnumone: '',
                countnumtwo: '',
                countnumthree: '',
            },
            //查看时的数据
            datares:{
                leftdata:{},
                sale_packdata:{},
                prodata:[]
            },
            dname: '',
            remarklength:0,
            isshow:true,
        },
        computed:{
            sumnum(){
                var m = 0;
                var w = 0;
                this.datares.prodata.forEach(e => {
                    m+= Number(e.ctn_m3);//体积
                    w+= Number(e.ctn_kgs);//重量
                });
                return [m,w];
            }
        },
        methods: {
            formatUnit: formatUnit,
            setPage(pageCurrent, pageSum, pagination) {
                //数据总条数
                var myPageCount = pageSum;
                //一页显示多少条
                var myPageSize = this.pageSize;
                //总页数
                var countindex = myPageCount % myPageSize > 0 ? (myPageCount / myPageSize) + 1 : (myPageCount / myPageSize);
                $.jqPaginator(pagination, {
                    totalPages: parseInt(countindex),
                    //最多显示多少页
                    visiblePages: 5,
                    //默认显示第几页
                    currentPage: pageCurrent,
                    first: '<li class="first"><a href="javascript:;">' + langcon.page_home + '</a></li>',
                    prev: '<li class="prev"><a href="javascript:;"><i class="arrow arrow2"></i>' + langcon.previous_page + '</a></li>',
                    next: '<li class="next"><a href="javascript:;">' + langcon.next_page + '<i class="arrow arrow3"></i></a></li>',
                    last: '<li class="last"><a href="javascript:;">' + langcon.last_page + '</a></li>',
                    page: '<li class="page"><a href="javascript:;">{{page}}</a></li>',
                    all: '<li class="page"><a href="javascript:;">' + myPageCount + ' / ' + this.page + 'PG , ' + this.pageSize + ' /PG</a></li>',
                    onPageChange: (num, type) => {
                        if (type == "change") {
                            this.page = num
                            this.getAllList()
                        }
                    }
                });
            },
            //数据所有获取
            getAllList(){
                $('.loding').show();
                $.ajax({
                    url: "/admin/finance/enchaseboxer",
                    type: 'post',
                    data: {
                        status: this.status,//页面标签
                        getdata: '',//获取标志
                        dname: this.dname,//搜索
                        page: this.page,
                        admin_id:this.admin_id,
                        pageSize: this.pageSize,
                    },
                    dataType: "json",
                    success: (result) => {
                        $('.loding').hide();
                        let arr = [];
                        result.data.forEach(item => {
                            let index = $.inArray(item.sale_id, arr);
                            if (index >= 0) {
                                item.sale_id = '';
                            }
                            arr.push(item.sale_id);
                        })

                        this.countnum.countnumone = result.arrcount.one;
                        this.countnum.countnumtwo = result.arrcount.two;
                        this.countnum.countnumthree = result.arrcount.three;
                        let pagination = '';
                        if (this.status == 1) {
                            this.listone = result.data;
                            pagination = '#paginationone';
                        } else if (this.status == 2) {
                            this.listwo = result.data;
                            pagination = '#paginationtwo';
                        } else if (this.status == 3) {
                            this.listhree = result.data;
                            pagination = '#paginationthree';
                        }
                        if (result.count) {
                            $('.loding').hide()
                            this.setPage(parseInt(this.page), result.count, pagination)
                        }
                    }
                })
            },
            //设置popper组件的配置
            setpopper(e){
                $(e.target).popover({
                    trigger: 'hover focus manual',
                    placement: ($(e.target).attr("placement") == undefined) ? 'left' : $(e.target).attr("placement"),
                    //placement:'left',
                    title: $(e.target).attr("title"),
                    html: 'true',
                    content: $(e.target).find(".content").html(),
                    animation: false
                });
            },
            //隐藏需要隐藏的部分
            datapopover(){
                $.each($("[data-toggle='popover']"), (key, value) => {
                    $(value).find(".content").hide();
                })
            },
            //查找
            render(){
                //搜索条件满足才进行搜索
                this.getAllList()
            },
            //标签切换
            changestatus(status){
                this.status = status;
                this.getAllList()
            },
            //时间的走动
            timer(){
                if (this.status == 1) {
                    this.listone.forEach(e => {
                        var start = e.interval_time.split(":");
                        var one = start[0];//小时
                        var two = start[1];//分
                        var three = start[2];//秒
                        three++
                        if (three == 60) {
                            two++;
                            if (two == 60) {
                                one++
                                two = 0
                            }
                            three = 0
                        }
                        if (one.toString().length == 1) {
                            one = '0' + one
                        }
                        if (two.toString().length == 1) {
                            two = '0' + two
                        }
                        if (three.toString().length == 1) {
                            three = '0' + three
                        }
                        e.interval_time = one + ':' + two + ":" + three
                    });
                }
            },
            //勾选自己的工作
            checkadmin(){
                this.admin_id=!this.admin_id;
                this.getAllList();
            },
            //获取这个销售订单数据
            chakan(sale_id){
                $.ajax({
                    url: "/admin/finance/enchasechakan",
                    type: 'post',
                    data: {
                        chakan: '',//获取标志
                        sale_id:sale_id,//销售订单id
                    },
                    dataType: "json",
                    success: (result) => {
                        this.datares.leftdata=result.leftdata;//左侧数据
                        this.datares.sale_packdata=result.sale_packdata;//装箱单数据
                        this.remarklength=this.datares.leftdata.remark.length;//备注长度
                        this.datares.prodata=result.prodata;//产品数据
                    }
                })
            },
            //页面存储
            gotoboxing(){
                var storage=window.localStorage;
                storage.setItem('pageboxing',this.page);//分页
                storage.setItem('statusboxing',this.status);//状态
                storage.setItem('dnameboxing',this.dname);//搜索
                storage.setItem('admin_idboxing',this.admin_id);//显示自己的工作
            }
        },
        created(){
            var storage=window.localStorage;
            if($('#formMenu').text() != 1){
                //返回列表
                if(storage.getItem('pageboxing')){
                    this.page= storage.getItem("pageboxing");
                    this.status=storage.getItem('statusboxing');
                    this.dname= storage.getItem('dnameboxing');
                    this.admin_id=storage.getItem('admin_idboxing');
                }
            }
            storage.removeItem("pageboxing");
            storage.removeItem('statusboxing');
            storage.removeItem('dnameboxing');
            storage.removeItem('admin_idboxing');
            setInterval(this.timer, 1000);
            this.getAllList();//数据
            this.datapopover();//插件
        }
    })
</script>